<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@include file="/layout/head.jsp"%>

<link href="layout/explore.css" rel="stylesheet" type="text/css"
	media="screen" />

<script type="text/javascript" src="javascript/explore.js"></script>
</head>
<body>
	<%@include file="/layout/bodyHeader.jsp"%>

	<h1>Explore My Budget</h1>

	<c:if test="${fn:length(userMessages) > 0}">
		<div class="userMessages">

			<ul class="userMessages">
				<c:forEach items="${userMessages}" var="_userMessage">
					<li class="userMessage">${_userMessage}</li>
				</c:forEach>
			</ul>

		</div>
	</c:if>

	<div class="post">
		<h2 class="title"><spring:message code="budgetSummary.label" /></h2>
		<div class="entry">

			<table>
				<tbody>
					<tr>
						<td><spring:message code="incomeSubtotal.label" /></td>
						<td class="currency"><c:out value="${incomeSubtotal}" /></td>
					</tr>
					<tr>
						<td><spring:message code="expensesSubtotal.label" /></td>
						<td class="currency"><c:out value="${expenseSubtotal}" /></td>
					</tr>
					<tr class="total odd">
						<td><spring:message code="netBudgetTotal.label" /></td>
						<td class="currency"><c:out value="${netBudgetTotal}" /></td>
					</tr>
				</tbody>

			</table>

		</div>
	</div>


	<div class="post">
		<h2 class="title"><spring:message code="expensesByCategory.label" /></h2>
		<div class="entry">

			<table>
				<thead>
					<tr>
						<th><spring:message code="item.category.label" /></th>
						<th><spring:message code="total.label" /></th>
					</tr>
				</thead>

				<tbody>
					<c:forEach items="${expenseCategoryTotals }" var="_total"
						varStatus="_status">
						<tr class="<c:if test="${_status.index %2 == 0 }">odd</c:if>">
							<td><c:out value="${_total.category.displayName}" /></td>
							<td class="currency"><c:out value="${_total.total}" /></td>
						</tr>
					</c:forEach>
				</tbody>

			</table>

		</div>
	</div>

	<div style="clear: both;">&nbsp;</div>


	<%@include file="/layout/bodyFooter.jsp"%>
</body>
</html>
